import random
class Player:
    def __init__(self, name):
        self.name = name

    def guess(self):
        return random.choice(['石头', '剪刀', '布'])

class Game:
    def __init__(self):
        self.player1 = Player('玩家1')
        self.player2 = Player('玩家2')

    def play(self):
        guess1 = self.player1.guess()
        guess2 = self.player2.guess()

        if guess1 == guess2:
            print('平局！')
        elif guess1 == '石头' and guess2 == '剪刀':
            print('玩家1获胜！')
        elif guess1 == '石头' and guess2 == '布':
            print('玩家2获胜！')
        elif guess1 == '剪刀' and guess2 == '石头':
            print('玩家2获胜！')
        elif guess1 == '剪刀' and guess2 == '布':
            print('玩家1获胜！')
        elif guess1 == '布' and guess2 == '石头':
            print('玩家1获胜！')
        elif guess1 == '布' and guess2 == '剪刀':
            print('玩家2获胜！')

if __name__ == '__main__':
    game = Game()
    game.play()